<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/axios.min.js"></script>
</head>
<body>
    <button>发送请求</button>
</body>
<script>
    document.querySelector("button").onclick = async function(){
		try{
			const {data} = await axios.get("http://zhangpeiyue.com/scoreList",{
				timeout:3000,// 如果请求时间超过3秒钟，那么会停止继续的请求
			});
			console.log(data);
        }catch (err){
			if(err.code === "ECONNABORTED"){
				alert("连接超时，请稍后再试")
            }
			console.log(err);
        }

    }
</script>
</html>